<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<jsp:include page="/common/commonCss.jsp"/>
<jsp:include page="/common/commonJs.jsp"/>
<title>嘉童游乐中心-审核商品定价清单</title>
</head>
<script type="text/javascript">
		function handPrice(idFlag){
			var  flag;
			if(idFlag=="1"){
				flag=$("input:[name='result3']:checked").val();
				$("#cateId").val(flag);
				handle("您确定要提交吗?");
			}else {
				flag=idFlag;
				$("#cateId").val(flag);
				handle("您确定要退单吗?");
			}
		}
		function  handle(message){
			$.messager.confirm('温馨提示', message, function(flag) {
				if (flag) {
					$("#hide_loading").show();
					$.ajax({
						url:"${basePath}scmInvocing/priceManager/handPriceForBranch.shtml",
						dataType:"json",
						type:"post",
						async:false,
						data:$("#handleForm").serialize(),
						error : function(XMLHttpRequest) {
				 				ajaxError(XMLHttpRequest);
				 		},
						success:function(result){
							 if(result=="1"){
								 $("#hide_loading").hide();
				 				 window.location.href="${basePath}scmInvocing/priceManager/forwardToList.shtml";
							 }
						}
					});
				}
			});
			
		}
</script>
<body class="bg">
<div class="content m_auto">
 <div class="content_l mt10">
    	<ul>
    		<shiro:hasPermission name="scmInvocing/productInfo/forwardToProductInfo.shtml">
    				  <li ><a href="${basePath}scmInvocing/productInfo/forwardToProductInfo.shtml"><i class="nav_icon_b"></i><br>商品信息</a></li>
    		</shiro:hasPermission>
    		 <shiro:hasPermission name="scmInvocing/countUnit/forwardToUnitInfo.shtml">
    		 		<li><a href="${basePath}scmInvocing/countUnit/forwardToUnitInfo.shtml"><i class="nav_icon_b"></i><br>单位设置</a></li>
    		 </shiro:hasPermission>
    		 <shiro:hasPermission name="scmInvocing/supplier/forwardToSupply.shtml">
    		 		   <li><a href="${basePath}scmInvocing/supplier/forwardToSupply.shtml"><i class="nav_icon_a"></i><br>供应商信息</a></li>
    		 </shiro:hasPermission>
    		  <shiro:hasPermission name="scmInvocing/priceManager/forwardToList.shtml">
    		 		  <li   class="content_hover"><a href="${basePath}scmInvocing/priceManager/forwardToList.shtml"><i class="nav_icon_f"></i><br>价格管理</a></li>
    		 </shiro:hasPermission>
    		   <shiro:hasPermission name="scmInvocing/scmPurOrder/findInvoPurOrder.shtml">
            	  <li><a href="${basePath}scmInvocing/scmPurOrder/findInvoPurOrder.shtml"><i class="nav_icon_b"></i><br>采购订单</a></li>
    		 </shiro:hasPermission>
    		   <shiro:hasPermission name="scmInvocing/scmPayForm/findInvoOrderPay.shtml">
           		   <li><a href="${basePath}scmInvocing/scmPayForm/findInvoOrderPay.shtml"><i class="nav_icon_b"></i><br>付款申请</a></li>
    		 </shiro:hasPermission>
   		</ul>
    </div>
    <div class="content_r mt10">
    	<div class="p20">
    	<div class="file_single_dl f14 fixed">
    	<form action="${basePath}scmInvocing/priceManager/handPriceForBranch.shtml" id="handleForm"  method="post">
    		<input type="hidden"  name="fkFlowinstId" value="${entity.fkFlowinstId}"/>
    		 <input type="hidden"  name="pkPriceId" value="${entity.pkPriceId}"/>
    		 <input type="hidden"  name="fkPrdId" value="${entity.fkPrdId}"/>
    		<input type="hidden"  name="cateId" id="cateId" value=""/>
             <dl class="fixed"  >
                <dd ><label><h1>商品定价清单</h1></label></dd>
            </dl>
            <dl class="fixed"  >
                <dd><label>定价人：</label>${entity.userName}</dd> <dd ><label>定价日期：</label>${nowData}</dd>
                <dd><label>定价单位：</label>${entity.branName}</dd>
            </dl>
       		 <dl class="fixed"  >
                <dd ><label>商品编号：</label> <input type="text" class="iput_t w200" value="${entity.fkPrdId}" disabled>  </dd> 
                <dd ><label>商品名称：</label> <input type="text" class="iput_t w200" value="${entity.prdName}" disabled>  </dd>
            </dl>
      		 <dl class="fixed"  >
                <dd ><label> 计量单位：</label> <input type="text" class="iput_t w200" value="${entity.unitName}" disabled>  </dd> 
                <dd ><label>商品规格：</label> <input type="text" class="iput_t w200" value="${entity.prdSpec}" disabled>  </dd>
            </dl>
               <dl class="fixed"  >
                <dd ><label> 商品分类：</label> <input type="text" class="iput_t w200" value="${entity.cateName}" disabled>  </dd> 
                <dd ><label>市场销售价：</label> <input type="text" class="iput_t w200" value="${entity.marketPrice}" disabled>  </dd>
            </dl>
            </br>
            <dl class="fixed"  >
                <dd ><label> 允许分店定价：</label>
                			<c:choose>
                					<c:when test="${entity.isAllow=='1'}">
                							<input type="text" disabled="disabled"  class="iput_t w200" value="是"/>
                					</c:when>
                					<c:otherwise>
                							<input type="text" disabled="disabled"  class="iput_t w200" value="否"/>
                								
                					</c:otherwise>
                			</c:choose>
                </dd>
                         <div id="fendianP" style="display:block"><dd ><label>分店价格：</label>
                          <input type="text" class="iput_t w200" value="${entity.branchPrice}"  disabled="disabled">  
                          </dd></div>
               
            </dl>
             <dl class="fixed"   >
              <dd ><label>总部价格：</label> <input type="text" class="iput_t w200" value="${entity.headPrice}" disabled >  </dd>
            </dl>
             <dl class="fixed"   >
              <dd><label>备注：</label><textarea disabled class="textare w200"  >${entity.comments}</textarea></dd>
            </dl>
            <dl class="fixed order_dl">
				<label>处理历史：</label>
                <div class="w630 fl">
                <table class="table">
                                <tbody><tr>
                                    <th>时间</th>
                                    <th>处理人</th>
                                    <th>结果</th>
                                    <th>处理意见</th>
                                </tr>
                                <!-- 处理历史 -->
                                <c:forEach items="${entity.workflowVo.optHisVoList}" var="his">
                                				<tr>
														<td style="width: 40%">${his.optTime }</td>
														<td>${his.optName }</td>
														<td>${his.result }</td>
														<td title="${his.advice}">
														<c:if test="${his.advice != null}">
															<c:choose>
																<c:when test="${his.advice.length() > 5}">
																	${his.advice.substring(0,5)}...
																</c:when>
																<c:otherwise>
																	${his.advice}
																</c:otherwise>
															</c:choose>
														</c:if>
														</td>
												</tr>
                                </c:forEach>
                            </tbody></table>
                            </div>
            	</dl>
             <dl class="fixed mt10"   >
              <dd>
                        	<label>审批结果：</label>
                            <input type="radio" name="result3" value="3" checked="checked" style="width:20px">同意　　　
                            <input type="radio" name="result3" value="4" >不同意
                        </dd>
                        <dd>
                        	<label>审批意见：</label>
                            <textarea class="textare w200" name="cateName"></textarea>
                        </dd>
            </dl>
            </form>
        </div>
      <div class="btm_btn mt10">
                    <dl>
                        <dd><input type="button" class="btn" value="提交" onclick="handPrice('1');"></dd>
                        <dd><input type="button" class="btn" value="退单" onclick="handPrice('5');"></dd>
                        <dd><input type="button" class="btn" value="返回" onclick="javascript:window.location.href='${basePath}scmInvocing/priceManager/forwardToList.shtml'"></dd>
                    </dl>
            </div>
             <div id="hide_loading">
				<div class="loading"></div>    
			    <div class="loading_bg" ></div>	
			</div>
        </div>
    </div>
</div>
</body>
</html>